#define _CRT_SECURE_NO_WARNINGS 1
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;

class Solution {
public:
    int pivotIndex(vector<int>& nums) {
        int n = nums.size();
        vector<int> arr(n + 1, 0);
        for (int i = 1; i <= n; i++)
        {
            arr[i] = arr[i - 1] + nums[i - 1];
        }
        int target = -1;
        for (int i = 0; i < n; i++)
        {
            if (arr[i + 1 - 1] == arr[n] - arr[i] - nums[i])
            {
                target = i;
                break;
            }
        }
        return target;
    }
};

int main() {
    return 0;
}